package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.MallDrawActivityProp;
import com.sc.nft.mapper.MallDrawActivityPropMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class MallDrawActivityPropDao extends ServiceImpl<MallDrawActivityPropMapper, MallDrawActivityProp> {

    public List<MallDrawActivityProp> listByActivityId(Long activityId) {
        LambdaQueryWrapper<MallDrawActivityProp> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(MallDrawActivityProp::getActivityId, activityId);
        return list(queryWrapper);
    }

    public Boolean removeByActivityId(Long activityId) {
        LambdaQueryWrapper<MallDrawActivityProp> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(MallDrawActivityProp::getActivityId, activityId);
        return this.remove(wrapper);

    }
}
